﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.Data;
using Ylh.FactoryDAL;
using Ylh.IDAL;

namespace Ylh.BLL
{
  public class CustFollowBLL
    {

       private string ConStr = string.Empty;

       public CustFollowBLL(string ConStr)
       {
           this.ConStr = ConStr;
       }


        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int InsertFlowInfo(Ylh.Model.TbCustFollow model)
        {
          Ylh.IDAL .ICustFollow icf= DataAccess.CreateICustFollow();
          return icf.InsertFlowInfo(ConStr, model);
        }
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool UpdateFlowInFo(Ylh.Model.TbCustFollow model)
        {
            Ylh.IDAL.ICustFollow icf = DataAccess.CreateICustFollow();
            return icf.UpdateFlowInFo(ConStr, model);
        }

        public DataTable GetFlowData( string CustID, string StaffID)
        {
            Ylh.IDAL.ICustFollow icf = DataAccess.CreateICustFollow();
            return icf.GetFlowData(ConStr, CustID, StaffID);
        }



        /// <summary>
        /// 删除一条数据
        /// </summary>
        public bool Delete( int CustFollow)
        {

            Ylh.IDAL.ICustFollow icf = DataAccess.CreateICustFollow();
            return icf.Delete(ConStr, CustFollow);
        }


        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Ylh.Model.TbCustFollow GetModel(int CustFollow)
        {
            Ylh.IDAL.ICustFollow icf = DataAccess.CreateICustFollow();
            return icf.GetModel(ConStr, CustFollow);
        }

        public void Delete(List<string> li)
        {
            foreach (string  str in li)
            {
                Delete(Convert.ToInt32(str));
            }
        }

        /// <summary>
        /// 获取是否存在上门拜访的这种情况
        /// </summary>
        /// <param name="ConStr"></param>
        /// <param name="CustID">客户编号</param>
        /// <returns></returns>
        public bool GetModelByMetting(string CustID)
        {
            Ylh.IDAL.ICustFollow icf = DataAccess.CreateICustFollow();

            return icf.GetModelByMetting(ConStr, CustID);

        }


    }
}
